////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __WN_MATH_SEGMENT_3_H__
#define __WN_MATH_SEGMENT_3_H__

#include "WNCore/inc/WNTypes.h"
#include "WNMath/inc/WNPoint3.h"

namespace WNMath {
    class WNLine2;
    class WNLine3;
    class WNRay2;
    class WNRay3;
    class WNVector3;

    class WNSegment3 {
    public:
        WNSegment3();
        explicit WNSegment3(const WN_FLOAT32* _f);
        explicit WNSegment3(const WNPoint3& _start, const WNPoint3& _end);

        WNSegment3 operator + () const;
        WNSegment3 operator - () const;

        WN_BOOL operator == (const WNSegment3& _seg) const;
        WN_BOOL operator != (const WNSegment3& _seg) const;

        WN_VOID Zero();

        WN_FLOAT32 Length() const;
        WN_FLOAT32 LengthSquared() const;
        WNVector3 Direction() const;

        WN_BOOL IsZero() const;

        WN_VOID Set(const WN_FLOAT32* _f);
        WN_VOID Set(const WNPoint3& _start, const WNPoint3& _end);

        WNLine2 ToLine2() const;
        WNLine3 ToLine3() const;
        WNRay2 ToRay2() const;
        WNRay3 ToRay3() const;

    public:
        WNPoint3 start;
        WNPoint3 end;
    };
}

#endif // __WN_MATH_SEGMENT_3_H__